#ifndef PARTICLESOURCE3D_LOAD_H
#define PARTICLESOURCE3D_LOAD_H

#include <vector>
#include "ParticleSource3D.h"
#include "../Tool/Timer.h"


using namespace std;

class ParticleSource3D_Load : public ParticleSource3D
{

public:

    ParticleSource3D_Load(PicParams* params_, ParallelMPI* pmpi_, PhysicalField* fields_, vector<Species*>* vecSpecies_, ParticleSourceParameter ps_param_);

    ~ParticleSource3D_Load();



    //Method called in the main pic loop to apply collision at each timestep
    void emitLoad(int itime);

    //=================Parameters for loading particles=================
    string loadKind;
    double loadDensity;
    double load_temperature;
    //load density per second [m-3 s-1]
    double load_dn;
    int load_step;
    //Number of particles loaded in one cell at one load_step
    int load_number;
    //load_number_rem = load_step * load_dn *... - load_number
    double load_number_rem;
    double load_number_rem_tot;

    //Count timer
    vector<Timer> timer;







private:
    double dt_ov_dx;
    double dt;
    double YZArea;

    double weight_const;
    //nominalDensity and nomPtclsPerCell is used to set the weight_const
    //weight_cosnt = nominalDensity * CellVolume / nomPtclsPerCell
    double nominalDensity;
    double nomPtclsPerCell;
    //emitting tempreature


};


#endif
